<template>
  <!-- 排行榜 -->
    <div class="ranking">
        <h3 class="ranking-title">播放排行榜</h3>
        <ul class="ranking-list">
          <router-link :to="routerURl.anime+item.id" v-for="item in TheChartsList" :key="item">
            <li class="ranking-item">
              <span class="ranking-number">{{Index++}}</span>
              <div class="ranking-info">
                <div class="ranking-name">{{item.rankingName}}</div>
                <div class="ranking-views">播放: {{item.rankingViews}}</div>
              </div>
            </li>
          </router-link>
        </ul>
    </div>
</template>

<script setup>
import {routerURl} from "@/utils/Request.js";

const props = defineProps({
    TheChartsList:{
        default:[
            {id:1,rankingName:'鬼灭之刃 刀匠村篇',rankingViews:'98.4万'},
            {id:2,rankingName:'我推的孩子',rankingViews:'90.7万'},
            {id:4,rankingName:'为美好的世界献上爆焰！',rankingViews:'90.4万'},
            {id:3,rankingName:'天国大魔境',rankingViews:'89.7万'}
        ]
    }
})
let Index = 1
</script>

<style scoped>
a{
    text-decoration: none;
    color: #3498db;
}
.ranking {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.ranking-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #3498db;
}

.ranking-list {
    list-style: none;
}

.ranking-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.ranking-item:hover {
    background-color: #f5f5f5;
}

.ranking-number {
    font-weight: bold;
    color: #3498db;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-size: 14px;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ranking-views {
    font-size: 12px;
    color: #888;
}
</style>